/*
 * sourcesignalposition.h
 *
 *  Created on: Jan 3, 2010
 *      Author: zaca
 */

#ifndef SOURCESIGNALPOSITION_H_
#define SOURCESIGNALPOSITION_H_

#include <biosignal/util/defined.h>

#include <string>
#include <map>

namespace biosignal {

class PositionUndefined: public std::exception {
public:
	PositionUndefined(std::string label="") :
		m_label(label) {

	}
	virtual ~PositionUndefined() throw (){
	}
	virtual const char* what() const throw () {
		std::string error("the position is undefined : ");
		error += m_label;
		return error.c_str();
	}
private:
	std::string m_label;

};

class Position : public Defined<Position>{
public:
	Position() {

	}
	Position(double theta, double phi, double radius) :
		m_theta(theta), m_phi(phi), m_radius(radius) {
		defined = true;
	}
	double theta() const {
		if (!defined)
			throw PositionUndefined();
		return m_theta;
	}
	double phi() const {
		if (!defined)
			throw PositionUndefined();
		return m_phi;
	}
	double radius() const {
		if (!defined)
			throw PositionUndefined();
		return m_radius;
	}
private:
	double m_theta;
	double m_phi;
	double m_radius;

};

}
#endif /* SOURCESIGNALPOSITION_H_ */
